<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="../css/pintuer.css">
<link rel="stylesheet" href="../css/admin.css">
<script src="../js/jquery.js"></script>
<script src="../js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 问题类型列表</strong> </div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="${ctx }/serve/issueTypeForm.jsp"> 添加内容</a> </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th>名称</th>
        <th>状态</th>
		<th>创建时间</th>
        <th width="250">操作</th>
      </tr>  		 
         <c:forEach items="${issueTypeList }" var="issueType">
         	<tr>
	          <td style="text-align:left; padding-left:20px;">${issueType.id }</td>
	          <td>${issueType.issueTypeName }</td>
	          <td>
	          	<c:if test="${issueType.status==1 }">
      				<font color="green">正常</font>
      			</c:if>
      			<c:if test="${issueType.status==2 }">
      				<font color="red">停用</font>
      			</c:if>
			  </td>
			  <td>${issueType.dateFormat }</td>
	          <td>
	          	<div class="button-group"> 
	          		<a class="button border-main" href="${ctx }/issueType/findById?id=${issueType.id}"><span class="icon-edit"></span> 修改</a> 
	          		<!--<a class="button border-red" href="javascript:void(0);" onclick="return del(${issueType.id})"><span class="icon-trash-o"></span> 删除</a>-->
	          		<c:if test="${issueType.status==1 }">
	          			<a class='button border-red' href='javascript:void(0)' onclick='return pause(${issueType.id})'><span class='icon-ban'></span> 停用</a>
	          		</c:if>
	          		<c:if test="${issueType.status==2 }">
	      				<a class='button border-main' href='javascript:void(0)' onclick='return start(${issueType.id})'><span class='icon-check-circle-o'></span> 启用</a>
	      			</c:if>
	          	</div>
	          </td>
	        </tr>
         </c:forEach>
    </table>
  </div>
</form>
<script type="text/javascript">
//单个删除
/*function del(id){
	if(confirm("您确定要删除问题类型吗?")){
		window.location.href="${ctx }/issueType/delete?id="+id;
	}
}*/
function pause(id){
	if(confirm("您确定要停用吗?")){
		window.location.href="${ctx }/issueType/updateStatus?status=2&id="+id;
	}
}
function start(id){
	if(confirm("您确定要启用吗?")){
		window.location.href="${ctx }/issueType/updateStatus?status=1&id="+id;
	}
}
</script>
</body>
</html>